//
//  KLSearchTableHeader.m
//  KunLun
//
//  Created by Mac on 2018/1/17.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "KLSearchTableHeader.h"
@interface KLSearchTableHeader()

@end
@implementation KLSearchTableHeader
- (instancetype)initWithHandle:(void (^)())handle{
    if (self == [super initWithFrame:CGRectMake(0, 0, UIScreenWidth, 50)]) {
        self.backgroundColor = [UIColor whiteColor];
        STButton * buyButton = [[STButton alloc] initWithFrame:CGRectMake(20, 7, UIScreenWidth - 40, 36)
                                                         title:@"搜索"
                                                    titleColor:KL_secendTextColor
                                                     titleFont:16
                                                  cornerRadius:15
                                               backgroundColor:KL_backgroundColor
                                               backgroundImage:nil
                                                         image:[UIImage imageNamed:@"img_nav_search_normal"]];
        buyButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        buyButton.titleEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
        [buyButton setClicAction:^(UIButton *sender) {
            if (handle) {
                handle();
            }
        }];
        [self addSubview:buyButton];
    }
    return self;
}

@end
